Skip to content

Add bf16-qd8 convert operator support#10022

Open
GregoryComer wants to merge 2 commits into
google:masterfrom
GregoryComer:bf16-qd8-operator
Open

Add bf16-qd8 convert operator support#10022
GregoryComer wants to merge 2 commits into
google:masterfrom
GregoryComer:bf16-qd8-operator

Conversation

@GregoryComer
Copy link
Copy Markdown
Contributor

@GregoryComer GregoryComer commented Apr 21, 2026

Add operator-level support for dynamic (qd8) quantization from bf16 tensors.

As an aside, it looks like the convert-nc tests weren't previously built with cmake. I added it and verified they pass on ARM Mac.

Test Plan:

  • Ran cmake build and operator-level tests on ARM Mac.
  • Verified bazel build succeeds for the top-level XNNPACK target.

@GregoryComer GregoryComer marked this pull request as ready for review April 21, 2026 21:39
Comment thread src/operators/unary-elementwise-nc.c
@GregoryComer GregoryComer marked this pull request as draft May 8, 2026 23:35
@GregoryComer GregoryComer marked this pull request as ready for review May 18, 2026 23:28
@GregoryComer
Copy link
Copy Markdown
Contributor Author

@dsharlet I've added qu8 support and re-opened for review.

@GregoryComer
Copy link
Copy Markdown
Contributor Author

The test failure appears to be unrelated. I'll see if I can repro it locally:

2026-05-19T00:50:26.0739151Z [ RUN      ] UnaryTest/RealOps.op/fp32_log
2026-05-19T00:50:26.0739460Z ./ynnpack/kernels/unary/reference.h:568: Failure
2026-05-19T00:50:26.0739924Z The difference between expected and x(i) is 1.2293457984924316e-07, which exceeds tolerance, where
2026-05-19T00:50:26.0740439Z expected evaluates to -0.058213327080011368,
2026-05-19T00:50:26.0740754Z x(i) evaluates to -0.058213204145431519, and
2026-05-19T00:50:26.0741020Z tolerance evaluates to 1.1920928955078125e-07.
2026-05-19T00:50:26.0741408Z i = {2, 0, 0, 1, 1, 2, 0, 1}, a(i) = 0.94344866275787354 (0.94344866275787354)
2026-05-19T00:50:26.0741725Z Google Test trace:
2026-05-19T00:50:26.0742128Z ./ynnpack/base/test/fuzz_test.h:79: To replicate this failure, re-run the test with `--gunit_random_seed=60929`.
2026-05-19T00:50:26.0742599Z 
2026-05-19T00:50:26.0742809Z [  FAILED  ] UnaryTest/RealOps.op/fp32_log, where GetParam() = (9, 11) (100 ms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants